Welcome to Bryton in three hours.
OK, let's talk about no indexing in this cell.
We first just print our X1 to see how it looks like, and here I'm calling different values corresponding
to different rows and columns of X1 by defining the list of indices.
So in this example, I want the value corresponding to raw number zero and column number one and the
value corresponding to rule number three and column number four.
You can also define a range of values as your row or column indices.
For example, I want raw numbers, zero raw number one, but row number two, so I define zero for the
column here to two.
It gets all the elements from rule number zero.
But rule number two and here is my column number, which is column two.
Here is another example.
And this example.
I'm practicing negative indexing, so I'm getting a raw number, minus three, minus two, but minus
one and also column number one.
Column number two.
But column number three, I can always define an index released with any order of row or column number
that you want.
For example, we have here the index to be zero, then three, then two.
And then I use it for my row indices index one.
And I'm getting all the columns corresponding to these indices.
And it comes with the same order that I put it here in the high end, the list.
So first I'm going to get the wrong number zero, then rule number three.
Rule number two.
That's right.
So here is my X1.
And then here is the two values corresponding to rule number zero, column number one and number three,
column number four.
And then similarly for the rest of these mattresses here.
OK, let's talk about finding indices.
So, for example, if I want to find the index corresponding to the maximum values of X1 across a particular
axis, for example, axis number zero, then I use the function.
Arguments for the minimum we are using are mean and the corresponding axis.
You can also use the function are there and then put a conditional statement here corresponding to the
indices of your particular variable.
For example, here we are just focusing on the first column or column number zero of X1 and all the
rows.
And if there is any element that is less than or equal to half, then I want the indices of that particular
condition and then we are printing them in an organized way here for you.
So and so here is the indices of maximum values of X1 corresponding to axis number zero and then in
the axis of the minimum values of X1 across the axis one.
And here is there on the very first column of column number zero.
We have values of rows, listen, and equal to half and that happens at row number zero, row number
two and rule number three.
Let's talk about index assignment in Napa, we first check out the shape of our exemptive, then defining
to follow here.
The first Fallujah, which is with the county, Rheinhardt goes through the number of rows of my empty
mattress and the second loop goes through the columns of my empty mattress.
So they are going from a range of 012 and range of zero and three, respectively.
And then I have a condition here.
I say if my X one I not and not that particular element is greater than half, then my ex empty the
corresponding index.
Einat and Genard is equal to X one of Einat and Jayna to the power of two.
And if that condition is not true, then it's empty of inert and not going to be x one of Einat and
add to the power of half.
And then we're going to print the X empty.
So this Randy cell, as you see my X empty is not empty anymore.
It got the corresponding values depending on this if and L's condition.
OK, let's talk about Kampai vectors, Reuters and column vectors and the differences between them.
So I'm going to find ENVI one, which is X1 only the first row or number zero, but all the columns.
So I'll print them one and one shape.
As you see, the shape of Vivan is only five.
There is no second dimension for the shape tuple here.
That's because y one is just a vector.
It's not a vector or column vector because row vector has a second dimension as well as the column.
So if we want to turn this way one five values into a row vector, I'm going to define a Y one Rorvik
television and we can use the function nanpa expand dimension to expand the dimension of Y one across
a particular axis in this example, like the zero to get a vector.
I'm going to print them for you here.
So as you see, this is my vector and the world want Rovito Shape is one and five.
And here I have an example for a column actor.
So now my axis is one instead of zero.
So we expand the dimension across Axis one.
If I run this, you can see that the shape is now five and one.
And this is my column vector of by one, the same five value as we see in the vector, but now in the
form of a column vector.
OK, let's talk about non-pay array on array operations.
The first print for you here, the shape of our previously defined variables x1, x1, x3.
And we also define this variable X four, which is a random value of four rows and five columns, and
we're going to print it here.
So let's run this up.
So the shape of my X1 is four and five and for example the shape of my X4 is four and five.
So here we have an example for you.
Which Y one in this example is X1 times X and Y two is no.
I did that function and this is the product of X1 and x2, so x1 multiplied by X for using the multiplication
star notation requires x1 and X four to have same dimension or same shape.
That's Y x1 shape is four and five and X for shape is four and five as well.
And what it does is basically multiply each element of X1 to the corresponding element in X four.
But if that product requires that the total number of columns of the first vector to be equal to the
total number of rows of the second vector, that's Y five, the total number of columns of X1.
The first vector is equal to the total number of rows of the second vector x2, which is five.
So if I run this as I see the dimension of why one is four and five and the dimension of why two is
four and one and four is the total number of rows of X1, and one is the total number of columns of
text.
OK, let's talk about Arry concatenation in Python.
Similar to the previous section, we remind ourselves of the shape of X1 x2 and in three and here I'm
going to define and explore with the dimension of two and four.
So let's run this.
And here are the shapes corresponding to different mattresses that we define before.
So in this example, we're going to define why one.
And then we use the number that concatenate function open and close prentice's and within that prentice's
we have a tuple here.
And in that tuple you put the first array and the second array.
And if you have more array, you put them all back to back here like the third array force, Ali, and
so on.
And the corresponding axes that these mattresses or arrows here need to be concatenated in this example,
X1 and X4.
They both have similar number of columns.
That's why we can concatenate them across axis number zero or horizontal axis in terms of Y two, X1
and X3.
They have all the same number of arrows.
That's why we can concatenate them across the vertical axis or axis one this rudisill and see how the
shape of these concatenation look like.
So in terms of woven, the shape is six and five and six coming from the summation of four by two.
And in terms of right to the shape is four and seven, which seven is coming from the summation of X1
and three.
One of the very interesting attributes of Proton is summarizing your coding.
So as you see here, our first define my concatenation as Y one and Y two, and then here in the print
function I call y one shape or Y to the shape.
But how can I summarize all this once you have your concatenation here, if you just want the shape
of it, since this part of the code is an non-pay concatenated array so you can use the shape as the
attribute of that particular area and then get the shape within your print function or just as I need
another variable.
Similarly here for your right to you don't have to have a right to.
You can just summarise it as concatenation of X1 and A3 and then all of it that shape which gives you
the shape of concatenation of X1 and three.
So let's run this.
And as you see, this is the shape six and five and four and seven.
OK, here we're going to see how we can convert at least to an array and a temporary to at least so
let's open cells.
So in order to convert at least to an array, we first define a list.
And this list has sublist and each sublist.
The length of them are equal to one another.
Then in order to get this list into a form of an array, you simply use the function done by Arry and
put your list over there and then you get the array version of that list.
And here we are seeing that array and then you cannot use the length function anymore.
You have to use the shape function to see the size of that area.
And then we can also check the type of that area to see if it is a number or not as friendly as I say,
this is my list.
The number of element in the list is four.
That's the number of total sublist.
And then you have your array here, which is an umpire.
As you see, the type is Nampara and the shape is four and three.
And this four is basically this length of the total number of sublist, and three is basically the dimension
of each of your cells.
You can also convert an array to at least let's define an array called my array with the dimension of
five and three random values.
In order to turn it into this, you use nubby that in the array and then you use the to list function,
order open and transparent and then put your area over there.
So now you can see my list and you can see the length of my list, which should be five.
Let's run this.
As you see, this is your list, which is composed of five subleased each with three dimension or the
length of three and the total number of your sublist, which is five year.
Let's take a break and then continue to the next part of this lecture.